<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
         function add(){
         let xhr = new XMLHttpRequest()
        xhr.open("post", "http://localhost:4399/login")
        xhr.setRequestHeader("Content-Type","application/json")
        let obj={
            username:"admin",
            password:"123456",
        }
        xhr.send(JSON.stringify(obj))
        xhr.onreadystatechange = function(){
            if(xhr.readyState == 4){
            let res = JSON.parse(xhr.responseText)
            console.log(res);
        }
    }
    }
    add()
    </script>
</body>
</html>